package com.finger.statisticsservice.controller;


import com.finger.commonutils.R;
import com.finger.statisticsservice.entity.vo.EchartsQuerySearch;
import com.finger.statisticsservice.service.StatisticsDailyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * <p>
 * 网站统计日数据 前端控制器
 * </p>
 *
 * @author finger
 * @since 2022-01-29
 */
@RestController
@RequestMapping("/statisticsservice/statisticsdaily")
@CrossOrigin
public class StatisticsDailyController {

    @Autowired
    private StatisticsDailyService statisticsDailyService;

    @PostMapping("/updateRegisterCount/{day}")
    public R updateLoginCount(@PathVariable String day){

        statisticsDailyService.updateRegisterCount(day);

        return R.ok();
    }
    @PostMapping("/echarts/createEcharts")
    public R createEcharts(@RequestBody EchartsQuerySearch echartsQuerySearch){

        Map<String,Object> map = statisticsDailyService.getEchartsDate(echartsQuerySearch);

        return R.ok().data("data",map);
    }
}

